let babel = require('babel-core');
let types = require('babel-types');
const code = `import {uniq,extend,flatten,cloneDeep} from "lodash"`;
const visitor = {
    Identifier(path){
       if(path.node.name == 'uniq'){
           let newIdentifier = types.identifier('_uniq');
           path.replaceWith(newIdentifier);
       }
    }
}
const result = babel.transform(code,{
    plugins:[
        {visitor}
    ]
});
console.log(result.code);